<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title>同乡烩首页</title>
		<link rel="stylesheet" href="style.css">
		<link rel="stylesheet" href="css/bootstrap.min.css">
		<script src="js/js.cookie.js" type="application/javascript"></script>
		<script type="text/javascript" src="js/jquery-3.4.1.js"></script>
		<script src="js/jquery.cookie.js"></script>
		<script type="text/javascript">
			var cid;
			var oid;
			$(function (){
				var cname=$.cookie('ordername');
				$("#tijiao").click(function (){
					$(".clearfix").empty();
					/*查找菜品*/
					$.ajax({
						type:"get",
						url:"dishes/findFoodByPage.do",
						data:{
							"crux":$("#search").val()
						},
						dataType:"json",
						success:function (data){
							$.each(data,function (i,n) {
								$(".clearfix").append("<li><img src='images/"+n.image+"'alt='暂无图片'><h4>"+n.name+"</h4><div class='info'><input type='submit' value='加入购物车'onclick='insertCart("+n.foodid+")'></div></li>")
							})
						}
					})
					/*查找厨师*/
					$.ajax({
						type:"get",
						url:"cook/findCookBypage.do",
						data:{
							"crux":$("#search").val()
						},
						dataType:"json",
						success:function (data){
							$.each(data,function (i,n){
								$(".clearfix").append("<li><img src='images/"+n.image+"'alt='暂无图片'><h4>"+n.name+"</h4><div class='info'><input type='submit' value='预约该厨师'onclick='yuyue("+n.cookid+")'></div></li>")
							})
						}

					})

				})
				$.ajax({
					type:"get",
					url:"customer/findCustomerByName.do",
					async:false,
					data:{
						"name":cname
					},
					dataType:"json",
					success:function (data) {
						cid=data.customerid;
					}
				})

				$.ajax({
					type:"get",
					url:"order/findOrderByCid.do",
					async:false,
					data:{
						"cid":cid,
					},
					dataType:"json",
					success:function (data) {
						oid=data.orderid;
					}
				})
				/*alert(cname+"===="+cid+"====="+oid);*/
			})
			function insertCart(obj){
				$.ajax({
					type: "get",
					url:"buy/addCart.do",
					data: {
						"id":obj
					},
					dataType:"json",
					success:function (data) {
						if(data.result==1){
							location.href="shop_cart.html"
						}else{
							alert("添加失败");
						}
					}
				})
			}
			function yuyue(obj){
				/*alert(cid+"===="+oid);*/
				$.ajax({
					type:"get",
					url:"appointment/apCooker.do",
					data:{
						"orderid":oid,
						"customerid":cid,
						"cookid":obj,
					},
					dataType:"json",
					success:function (data) {
						if(data.result==1){
							location.href="cookdeal.html";
						}
					}
				})
			}
		</script>
	</head>

	<body>

	<div class="page-top">
		<div class="container">
			<div class="top-lt">
				<a href="index.html">同乡烩</a>
				<span>|</span>
				<!--            <a href="adm/pages/index.html">管理员</a>
                            <span>|</span>-->

			</div>

			<div class="top-gt">
				<div class="login">

					<a href="">欢迎光临同乡烩酒宴预约平台</a>

				</div>
			</div>
		</div>
	</div>
	</div>

	<!-- 1.头部区域开始 -->
	<div class="header w">
		<!-- logo部分 -->
		<div class="logo">
			<img src="images/logo.png" alt="暂无图片">
		</div>
		<!-- 导航栏部分 nav -->
		<div class="nav">
			<ul>
				<li><a href="#">首页</a></li>
				<li><a href="user-index.html">个人中心</a></li>

			</ul>
		</div>
		<!-- 搜索模块 -->
		<div class="search">
			<input type="text" id="search" placeholder="请输入关键词">
			<button id="tijiao"></button>
		</div>
		<!-- 注册登录模块 -->
		<div class="zc">
			<ul>
				<li><a href="login.html">登录</a></li>
				<li><a href="register.html">注册</a></li>
				<li><a href="shop_cart.html">购物车</a></li>
			</ul>

		</div>

	</div>
	<!-- 头部区域结束 -->
	<!-- 2. banner部分start -->

	<div class="banner">
		<!-- 版心 -->
		<div class="w">
			<!-- <nav> -->
			<div class="subnav">
				<ul class="level">
					<li><a href="#">粤菜 <span>〉</span></a>

						<div class="childer">
							<a href="food.html" class="pop-li">
								<img src="images/baiqieji.png">
								<p>白切鸡</p>
							</a><a href="bintanyanwo.html" class="pop-li">
							<img src="images/bingtanyanwo.png">
							<p>椰汁冰糖燕窝</p>
						</a><a href="" class="pop-li">
							<img src="images/cuipishaorou.png">
							<p>脆皮烧肉</p>
						</a><a href="" class="pop-li">
							<img src="images/julongxia.png">
							<p>上汤焗龙虾</p>
						</a><a href="" class="pop-li">
							<img src="images/lainiaoxia.png">
							<p>椒盐濑尿虾</p>
						</a><a href="" class="pop-li">
							<img src="images/liaoshen.png">
							<p>鲍汁扣辽参</p>
						</a><a href="" class="pop-li">
							<img src="images/lushuipingpan.png">
							<p>潮州卤水拼盘</p>
						</a><a href="" class="pop-li">
							<img src="images/ruge.png">
							<p>红烧乳鸽</p>
						</a><a href="" class="pop-li">
							<img src="images/xiangbaban.png">
							<p>白灼象拔蚌</p>
						</a><a href="" class="pop-li">
							<img src="images/xueha.png">
							<p>木瓜炖雪蛤</p>
						</a><a href="" class="pop-li">
							<img src="images/yudu.png">
							<p>百花鱼肚</p>
						</a><a href="" class="pop-li">
							<img src="images/mizhichashao.png">
							<p>蜜汁叉烧</p>
						</a>

						</div>
					</li>
					<li><a href="#">川菜 <span>〉</span></a>


						<div class="childer">
							<a href="" class="pop-li">
								<img src="images/chenpiniurou.png">
								<p>陈皮牛肉</p>
							</a><a href="" class="pop-li">
							<img src="images/douhuayu.png">
							<p>豆花鱼</p>
						</a><a href="" class="pop-li">
							<img src="images/guaiweijiding.png">
							<p>怪味鸡丁</p>
						</a><a href="" class="pop-li">
							<img src="images/huiwoyupian.png">
							<p>回锅鱼片</p>
						</a><a href="" class="pop-li">
							<img src="images/hutuji.png">
							<p>糊涂鸡</p>
						</a><a href="" class="pop-li">
							<img src="images/lanchitu.png">
							<p>麻辣冷吃兔</p>
						</a><a href="" class="pop-li">
							<img src="images/yuxuangrousi.png">
							<p>鱼香肉丝</p>
						</a><a href="" class="pop-li">
							<img src="images/malachaoxie.png">
							<p>麻辣炒蟹</p>
						</a><a href="" class="pop-li">
							<img src="images/paocaiyu.png">
							<p>麻辣泡菜鱼</p>
						</a><a href="" class="pop-li">
							<img src="images/mapo.jpg">
							<p>麻婆豆腐</p>
						</a><a href="" class="pop-li">
							<img src="images/xianlamaodou.png">
							<p>香辣毛豆</p>
						</a><a href="" class="pop-li">
							<img src="images/yanxunlarou.png">
							<p>烟熏腊肉</p>
						</a>

						</div>
					</li>

					<li><a href="#">苏菜 <span>〉</span></a>


						<div class="childer">
							<a href="" class="pop-li">
								<img src="images/dg.jpg">
								<p>剁椒冬瓜</p>
							</a><a href="" class="pop-li">
							<img src="images/niangaot.jpg">
							<p>火腿冬瓜年糕汤</p>
						</a><a href="" class="pop-li">
							<img src="images/jiaohu.jpg">
							<p>豆泡炒矮脚黄</p>
						</a> <a href="" class="pop-li">
							<img src="images/dg.jpg">
							<p>剁椒冬瓜</p>
						</a><a href="" class="pop-li">
							<img src="images/niangaot.jpg">
							<p>火腿冬瓜年糕汤</p>
						</a><a href="" class="pop-li">
							<img src="images/jiaohu.jpg">
							<p>豆泡炒矮脚黄</p>
						</a> <a href="" class="pop-li">
							<img src="images/dg.jpg">
							<p>剁椒冬瓜</p>
						</a><a href="" class="pop-li">
							<img src="images/niangaot.jpg">
							<p>火腿冬瓜年糕汤</p>
						</a><a href="" class="pop-li">
							<img src="images/jiaohu.jpg">
							<p>豆泡炒矮脚黄</p>
						</a> <a href="" class="pop-li">
							<img src="images/dg.jpg">
							<p>剁椒冬瓜</p>
						</a><a href="" class="pop-li">
							<img src="images/niangaot.jpg">
							<p>火腿冬瓜年糕汤</p>
						</a><a href="" class="pop-li">
							<img src="images/jiaohu.jpg">
							<p>豆泡炒矮脚黄</p>
						</a>

						</div>
					</li>

					<li><a href="#">鲁菜 <span>〉</span></a>


						<div class="childer">
							<a href="" class="pop-li">
								<img src="images/jip.png">
								<p>芙蓉鸡片</p>
							</a><a href="" class="pop-li">
							<img src="images/sy.png">
							<p>拔丝山药</p>
						</a> <a href="" class="pop-li">
							<img src="images/jip.png">
							<p>芙蓉鸡片</p>
						</a><a href="" class="pop-li">
							<img src="images/sy.png">
							<p>拔丝山药</p>
						</a> <a href="" class="pop-li">
							<img src="images/jip.png">
							<p>芙蓉鸡片</p>
						</a><a href="" class="pop-li">
							<img src="images/sy.png">
							<p>拔丝山药</p>
						</a> <a href="" class="pop-li">
							<img src="images/jip.png">
							<p>芙蓉鸡片</p>
						</a><a href="" class="pop-li">
							<img src="images/sy.png">
							<p>拔丝山药</p>
						</a> <a href="" class="pop-li">
							<img src="images/jip.png">
							<p>芙蓉鸡片</p>
						</a><a href="" class="pop-li">
							<img src="images/sy.png">
							<p>拔丝山药</p>
						</a> <a href="" class="pop-li">
							<img src="images/jip.png">
							<p>芙蓉鸡片</p>
						</a><a href="" class="pop-li">
							<img src="images/sy.png">
							<p>拔丝山药</p>
						</a>

						</div>
					</li>

					<li><a href="#">浙菜 <span>〉</span></a>


						<div class="childer">
							<a href="" class="pop-li">
								<img src="images/mantou.png">
								<p>南瓜馒头</p>
							</a><a href="" class="pop-li">
							<img src="images/kannaix.png">
							<p>温馨的康乃馨</p>
						</a><a href="" class="pop-li">
							<img src="images/dougao.png">
							<p>清香蚕豆糕</p>
						</a> <a href="" class="pop-li">
							<img src="images/mantou.png">
							<p>南瓜馒头</p>
						</a><a href="" class="pop-li">
							<img src="images/kannaix.png">
							<p>温馨的康乃馨</p>
						</a><a href="" class="pop-li">
							<img src="images/dougao.png">
							<p>清香蚕豆糕</p>
						</a> <a href="" class="pop-li">
							<img src="images/mantou.png">
							<p>南瓜馒头</p>
						</a><a href="" class="pop-li">
							<img src="images/kannaix.png">
							<p>温馨的康乃馨</p>
						</a><a href="" class="pop-li">
							<img src="images/dougao.png">
							<p>清香蚕豆糕</p>
						</a> <a href="" class="pop-li">
							<img src="images/mantou.png">
							<p>南瓜馒头</p>
						</a><a href="" class="pop-li">
							<img src="images/kannaix.png">
							<p>温馨的康乃馨</p>
						</a><a href="" class="pop-li">
							<img src="images/dougao.png">
							<p>清香蚕豆糕</p>
						</a>

						</div>
					</li>

					<li><a href="#">闽菜 <span>〉</span></a>


						<div class="childer">
							<a href="" class="pop-li">
								<img src="images/roust.png">
								<p>紫薯肉松塔</p>
							</a><a href="" class="pop-li">
							<img src="images/baoyanyu.png">
							<p>花生炖暴盐鱼</p>
						</a><a href="" class="pop-li">
							<img src="images/baogyu.png">
							<p>清蒸包公鱼</p>
						</a><a href="" class="pop-li">
							<img src="images/roust.png">
							<p>紫薯肉松塔</p>
						</a><a href="" class="pop-li">
							<img src="images/baoyanyu.png">
							<p>花生炖暴盐鱼</p>
						</a><a href="" class="pop-li">
							<img src="images/baogyu.png">
							<p>清蒸包公鱼</p>
						</a><a href="" class="pop-li">
							<img src="images/roust.png">
							<p>紫薯肉松塔</p>
						</a><a href="" class="pop-li">
							<img src="images/baoyanyu.png">
							<p>花生炖暴盐鱼</p>
						</a><a href="" class="pop-li">
							<img src="images/baogyu.png">
							<p>清蒸包公鱼</p>
						</a><a href="" class="pop-li">
							<img src="images/roust.png">
							<p>紫薯肉松塔</p>
						</a><a href="" class="pop-li">
							<img src="images/baoyanyu.png">
							<p>花生炖暴盐鱼</p>
						</a><a href="" class="pop-li">
							<img src="images/baogyu.png">
							<p>清蒸包公鱼</p>
						</a>
						</div>
					</li>

					<li><a href="#">徽菜 <span>〉</span></a>


						<div class="childer">
							<a href="" class="pop-li">
								<img src="images/doufuh.png">
								<p>书箱豆腐盒</p>
							</a><a href="" class="pop-li">
							<img src="images/bbaof.png">
							<p>甜蜜八宝饭</p>
						</a><a href="" class="pop-li">
							<img src="images/pidan.png">
							<p>剁椒金针拌皮蛋</p>
						</a><a href="" class="pop-li">
							<img src="images/doufuh.png">
							<p>书箱豆腐盒</p>
						</a><a href="" class="pop-li">
							<img src="images/bbaof.png">
							<p>甜蜜八宝饭</p>
						</a><a href="" class="pop-li">
							<img src="images/pidan.png">
							<p>剁椒金针拌皮蛋</p>
						</a><a href="" class="pop-li">
							<img src="images/doufuh.png">
							<p>书箱豆腐盒</p>
						</a><a href="" class="pop-li">
							<img src="images/bbaof.png">
							<p>甜蜜八宝饭</p>
						</a><a href="" class="pop-li">
							<img src="images/pidan.png">
							<p>剁椒金针拌皮蛋</p>
						</a><a href="" class="pop-li">
							<img src="images/doufuh.png">
							<p>书箱豆腐盒</p>
						</a><a href="" class="pop-li">
							<img src="images/bbaof.png">
							<p>甜蜜八宝饭</p>
						</a><a href="" class="pop-li">
							<img src="images/pidan.png">
							<p>剁椒金针拌皮蛋</p>
						</a>
						</div>
					</li>

					<li><a href="#">湘菜 <span>〉</span></a>


						<div class="childer">
							<a href="" class="pop-li">
								<img src="images/dunji.png">
								<p>胡萝卜炖鸡</p>
							</a><a href="" class="pop-li">
							<img src="images/yinsi.png">
							<p>炫彩银丝</p>
						</a><a href="" class="pop-li">
							<img src="images/qinjiaopng.jpg">
							<p>香干青椒</p>
						</a><a href="" class="pop-li">
							<img src="images/dunji.png">
							<p>胡萝卜炖鸡</p>
						</a><a href="" class="pop-li">
							<img src="images/yinsi.png">
							<p>炫彩银丝</p>
						</a><a href="" class="pop-li">
							<img src="images/qinjiaopng.jpg">
							<p>香干青椒</p>
						</a><a href="" class="pop-li">
							<img src="images/dunji.png">
							<p>胡萝卜炖鸡</p>
						</a><a href="" class="pop-li">
							<img src="images/yinsi.png">
							<p>炫彩银丝</p>
						</a><a href="" class="pop-li">
							<img src="images/qinjiaopng.jpg">
							<p>香干青椒</p>
						</a><a href="" class="pop-li">
							<img src="images/dunji.png">
							<p>胡萝卜炖鸡</p>
						</a><a href="" class="pop-li">
							<img src="images/yinsi.png">
							<p>炫彩银丝</p>
						</a><a href="" class="pop-li">
							<img src="images/qinjiaopng.jpg">
							<p>香干青椒</p>
						</a>
						</div>
					</li>


				</ul>
			</div>
			<!-- </nav> -->
		</div>
	</div>

	<div class="box w" >
		<div class="box-hd">
			<h3>精品推荐</h3>
			<a href="food-show.html">查看全部</a>
		</div>

		<div class="box-bd">
			<ul class="clearfix">
				<li>
					<a href="food.html">
					<img src="images/baiqieji.png" alt="">
					<h4>
						白切鸡
					</h4>
					</a>
					<div class="info">
						<input type="submit" value="加入购物车"/>
					</div>
				</li>
				<li>
					<a href="mapo.html">
					<img src="images/mapo.jpg" alt="">
					</a>
					<h4>
						麻婆豆腐
					</h4>
					<div class="info">
						<input type="submit" value="加入购物车"/>
					</div>
				</li>
				<li>
					<img src="images/qinjiaopng.jpg" alt="">
					<h4>
						香干青椒
					</h4>
					<div class="info">
						<input type="submit" value="加入购物车"/>
					</div>
				</li>
				<li>
					<img src="images/lazijiding.png" alt="">
					<h4>
						辣子鸡丁
					</h4>
					<div class="info">
						<input type="submit" value="加入购物车"/>
					</div>
				</li>
				<li>
					<img src="images/kannaix.png" alt="">
					<h4>
						温馨的康乃馨
					</h4>
					<div class="info">
						<input type="submit" value="加入购物车"/>
					</div>
				</li>
				<li>
					<img src="images/foodlist1.jpg" alt="">
					<h4>
						秘制饺子
					</h4>
					<div class="info">
						<input type="submit" value="加入购物车"/>
					</div>
				</li>
				<li>
					<img src="images/baogyu.png" alt="">
					<h4>
						清蒸包公鱼
					</h4>
					<div class="info">
						<input type="submit" value="加入购物车"/>
					</div>
				</li>
				<li>
					<img src="images/dunji.png" alt="">
					<h4>
						胡萝卜炖鸡
					</h4>
					<div class="info">
						<input type="submit" value="加入购物车"/>
					</div>
				</li>
				<li>
					<a href="yudu.html">
					<img src="images/yudu.png" alt="">
					</a>
					<h4>
						百花鱼肚
					</h4>
					<div class="info">
						<input type="submit" value="加入购物车"/>
					</div>
				</li>
				<li>
					<img src="images/yinsi.png" alt="">
					<h4>
						炫彩银丝
					</h4>
					<div class="info">
						<input type="submit" value="加入购物车"/>
					</div>
				</li>


			</ul>
		</div>

	</div>
	<!-- 4. box核心内容区域结束 -->

	<!-- 5. footer 模块制作 -->
	<div class="footer">
		<div class="w">
			<div class="copyright">
				<img src="images/logo.png" alt="">
				<p>同乡烩致力于为有需求的广大乡村用户提供一站式的酒宴预定服务
				</p>
				<!-- <a href="#" class="app">下载APP</a> -->
			</div>
			<div class="links">
				<dl>
					<dt>关于同乡烩</dt>
					<dd><a href="#">关于</a></dd>
					<dd><a href="#">管理团队</a></dd>
					<dd><a href="#">工作机会</a></dd>
					<dd><a href="#">客户服务</a></dd>
					<dd><a href="#">帮助</a></dd>
				</dl>
				<dl>
					<dt>关于服务</dt>
					<dd><a href="#">服务支持</a></dd>
					<dd><a href="#">售后政策</a></dd>
					<dd><a href="#">自助服务</a></dd>
					<dd><a href="#">相关机构</a></dd>

				</dl>
				<!--<dl>
                    <dt></dt>
                    <dd><a href="#">关于</a></dd>
                    <dd><a href="#">管理团队</a></dd>
                    <dd><a href="#">工作机会</a></dd>
                    <dd><a href="#">客户服务</a></dd>
                    <dd><a href="#">帮助</a></dd>
                </dl>-->

			</div>
		</div>
	</div>
	</body>

</html>
